# -*- coding: utf-8 -*- 
# 作者:飞虎
# 开发时间:2022/5/1 19:02
import sys
from PyQt5.Qt import *


class Window(QWidget):
	def __init__(self):
		super(Window, self).__init__()
		# super().__init__(*args, **kwargs)
		self.setWindowTitle("鼠标相关的操作")
		self.resize(500, 500)
		self.move(200, 200)
		#
		self.setMouseTracking(True)
		#
		pixmap = QPixmap('xxx.png').scaled(50, 50)
		cursor = QCursor(pixmap)
		self.setCursor(cursor)
		#
		label = QLabel(self)
		self.label = label
		self.label.setText('社会飞虎哥,人狠话不多')
		self.label.setStyleSheet('background-color:cyan;')

	def mouseMoveEvent(self, mv):
		# print('鼠标移动了', mv.localPos())
		# label = self.findChild(QLabel)
		self.label.move(int(mv.localPos().x()), int(mv.localPos().y()))


app = QApplication(sys.argv)
window = Window()

window.show()
sys.exit(app.exec_())
